package com.zhentao.admin.utils;

import com.zhentao.model.admin.rbac.SysUser;

/**
 * @ClassName: AdminUserThreadLocalUtils
 * @Author: 振涛教育_Q
 * @Date: 2024/12/26 20:21
 */
public class AdminUserThreadLocalUtils {
    private static final ThreadLocal<SysUser> SYS_USER_THREAD_LOCAL = new ThreadLocal<>();

    public static void setSysUser(SysUser sysUser) {
        SYS_USER_THREAD_LOCAL.set(sysUser);
    }

    public static SysUser getSysUser() {
        return SYS_USER_THREAD_LOCAL.get();
    }

    public static void removeSysUser() {
        SYS_USER_THREAD_LOCAL.remove();
    }
}
